#include "info.h"

Info::Info(QWidget *parent) : QDialog(parent), infoWindow(new Ui::Info)
{
    infoWindow->setupUi(this);

    //Info Signals & Slots: Developers Tab Changed
    connect(infoWindow->mike_Button, SIGNAL(clicked()), this, SLOT(mikeButton_Clicked()));
    connect(infoWindow->dave_Button, SIGNAL(clicked()), this, SLOT(daveButton_Clicked()));
    connect(infoWindow->julich_Button, SIGNAL(clicked()), this, SLOT(julichButton_Clicked()));
    connect(infoWindow->jesse_Button, SIGNAL(clicked()), this, SLOT(jesseButton_Clicked()));
    connect(infoWindow->joe_Button, SIGNAL(clicked()), this, SLOT(joeButton_Clicked()));
}

//Depending on what Developer button the user clicked developerButton_Check will be set to that developer's value
void Info::mikeButton_Clicked()
{
    developerButton_Check = 0;
    developerButton_Clicked();
}

void Info::daveButton_Clicked()
{
    developerButton_Check = 1;
    developerButton_Clicked();
}

void Info::julichButton_Clicked()
{
    developerButton_Check = 2;
    developerButton_Clicked();
}

void Info::jesseButton_Clicked()
{
    developerButton_Check = 3;
    developerButton_Clicked();
}

void Info::joeButton_Clicked()
{
    developerButton_Check = 4;
    developerButton_Clicked();
}

//Depending on what button the user clicked the appropriate Developer tab will be displayed
void Info::developerButton_Clicked()
{
    switch(developerButton_Check)
    {
        case(0):
            infoWindow->lifeSyncDevelopers_Tab->setCurrentIndex(developerButton_Check);
        case(1):
            infoWindow->lifeSyncDevelopers_Tab->setCurrentIndex(developerButton_Check);
        case(2):
            infoWindow->lifeSyncDevelopers_Tab->setCurrentIndex(developerButton_Check);
        case(3):
            infoWindow->lifeSyncDevelopers_Tab->setCurrentIndex(developerButton_Check);
        case(4):
            infoWindow->lifeSyncDevelopers_Tab->setCurrentIndex(developerButton_Check);
    }
}

Info::~Info()
{
    delete infoWindow;
}

void Info::on_closeInfo_Button_clicked()
{
    Info::close();
}
